package domain;

import java.util.ArrayList;
import java.util.List;

public class Customer {

	private int id;
	
	private String logon;

	private String name;

	private String email;

	private String password;

	private Address address;

	private Category category;

	private Shipping shipping;

	private Billing billing;

	private List<CartItem> cartItens;

	public Customer(String name, String password) {
		super();
		setLogon(logon);
		setPassword(password);
		this.category = Category.NewToGroup;
		this.cartItens = new ArrayList<CartItem>();
	}
	
	
	
	public Customer(int id, String logon, String name, String email,
			String password, Address address, Category category,
			Shipping shipping, Billing billing, List<CartItem> cartItens) {
		super();
		this.id = id;
		this.logon = logon;
		this.name = name;
		this.email = email;
		this.password = password;
		this.address = address;
		this.category = category;
		this.shipping = shipping;
		this.billing = billing;
		this.cartItens = cartItens;
	}



	public String getLogon() {
		return this.logon;
	}
	
	public void setLogon(String logon) {
		this.logon = logon;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getId() {
		return this.id;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	
	public Shipping getShipping() {
		return shipping;
	}
	
	public void setShipping(Shipping shipping) {
		this.shipping = shipping;
	}
	
	public Billing getBilling() {
		return billing;
	}
	
	public void setBilling(Billing billing) {
		this.billing = billing;
	}
	
	public List<CartItem> getCartItem(){
		return this.cartItens;
	}
	
	public void setCartItem(List<CartItem> cartItens){
		this.cartItens = cartItens;
	}
	
	public boolean AddCartItem(Product product, int quantity, float discount){
		CartItem item = new CartItem(quantity, discount, product);
		return this.cartItens.add(item);
	}
	
	public boolean RemoveCartItem(Product product, int quantity, float discount){
		CartItem item = new CartItem(quantity, discount, product);
		return this.cartItens.remove(item);
	}

}
